import { reactive } from 'vue'

interface AddState {
  // id
  id: string | undefined
  // 关键词
  name: string | undefined
  //tab状态
  status: number
}
// 状态管理
export const adState = reactive<AddState>({
  id: undefined,
  name: undefined,
  status: 1
})
interface IStatus {
  //列表类型切换
  isActiveModule: boolean
  isDisableModule: boolean
  isBySearch: boolean
}
// 列表类型切换
export const statusState = reactive<IStatus>({
  isActiveModule: false,
  isDisableModule: false,
  isBySearch: false
})
export const resetState = () => {
  for (const i in adState) {
    switch (i) {
      case 'id':
        adState[i] = undefined
        break
      case 'name':
        adState[i] = undefined
        break
    }
  }
}
